#ifndef __XMO__
#define __XMO__

namespace xm
{
	enum METHOD_OPTIONS
	{
		OPT_STATIC	= 1,
		OPT_VOID	= 2,
	};
	struct MethodInfo
	{
		UINT32	ParamCount;
		UINT32	Options;
	};

	enum XmoType
	{
		XmoVariant,
		XmoClass,
		XmoFunction,
		XmoInstance,
	};

	enum XmoInvokeType
	{
		XmoInvoke = 1,
		XmoGet = 2,
		XmoSet = 4,
	};

	struct XmoInfo
	{
		XmoType	Type;
	};

	class IClassDefinition
	{
	public:
		STDMETHOD(NewInstance)( xv::AnyValue& aParamArray, xv::AnyValue& obj ) PURE;
	};

	class IMember
	{
		XmoType	Type;
		SIZE_T	FastId;
		SIZE_T	NumParam;
		STDMETHOD(Get)( xv::AnyValue& retv ) PURE;
		STDMETHOD(Set)(xv::AnyValue& inv ) PURE;
		STDMETHOD(Invoke)( xv::AnyValue& args, xv::AnyValue& ret ) PURE;
	};

	class IInstance
	{
	public:
		STDMETHOD_(IMember*,QueryMember)( LPCSTR aMemberName, XmoInvokeType aAccType ) PURE;
		STDMETHOD_(IMember*,QueryMember)( SIZE_T aFastId, XmoInvokeType aAccType ) PURE;
	};

	class IMethod
	{
	public:
		STDMETHOD(GetInfo)( MethodInfo * infop ) PURE;
		STDMETHOD(Invoke)( xv::AnyValue& aParamArray, xv::AnyValue& ret ) PURE;
		DECLARE_IID;
	};

	class IExtendModule : public IUnknown
	{
	public:
		STDMETHOD(GetExtendInfo)(  IMethod ** ppMethod ) PURE;
	};


	// {EB929CD3-6898-4899-A9D1-EBECFC301121}
	DEFINE_IID(IExtendModule, "{EB929CD3-6898-4899-A9D1-EBECFC301121}",
		0xeb929cd3, 0x6898, 0x4899, 0xa9, 0xd1, 0xeb, 0xec, 0xfc, 0x30, 0x11, 0x21);

};


#endif